{% extends 'layout.html' %}

{% block main %}
<ol class="breadcrumb">
    <li><a href="/admin">管理首页</a></li>
    <li class="active">分类列表</li>
</ol>

<h1 class="page-header">分类列表</h1>
<div class="table-responsive">
  {% set a = 'category' %}
  {% include 'page.html' %}

  <table class="table table-striped table-hover">
    <thead>
      <tr>
        <th>分类名称</th>
        <th>ID</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>

      {% for category in categories %}
      <tr>
        <td> {{category.name}} </td>
        <td> {{category._id.toString()}} </td>
        <td> 
          <a href="/admin/category/edit?id={{category._id.toString()}}">修改</a> |  
          <a href="/admin/category/delete?id={{category._id.toString()}}">删除</a>  
        </td>
      </tr>
      {% endfor %}
    </tbody>
  </table>

</div>

{% endblock %}